<template>
	<view class="conter">

		<view class="header" style="color: #000000;" @tap="goBack()">
			<view class="arrow">
			</view>
			<view class="title">
				{{title}}
			</view>
		</view>




		<view class="text-tab">
			<view class="box">
				<view class="marige-bor" v-for="(item, index) in textList" :key="index" @tap="skip(item)">
					<view class="diso-flex">
						<view class="">
							{{item.store_name}}
						</view>
						<view class="conter-image">
							<image src="../../static/index/right.png" mode=""></image>
						</view>
					</view>
				</view>
			</view>
		</view>




		<view class="flex-box total">
			<view class="">
				合计：
			</view>
			<view class="">
				{{total}} 个
			</view>
		</view>

	</view>
</template>

<script>
	import headerBox from '../../components/header/header.vue'

	export default {
		components: {
			headerBox
		},
		data() {
			return {
				title: '仓库',
				textList: [],
				redactShow: false,
				showRemove: false,
				showRemove1: false,
				showRemove2: false,
				tabText: 0,
				total: 0,
				val: '',
				valName: '',
				stockName: '',
				stocId: '',
				value: 1,
				searchVal: '',
			}
		},
		onLoad() {
			this.stockList()
		},
		onShow() {
			uni.removeStorageSync('addlist');
			uni.removeStorageSync('stockId');
		},
		methods: {

			goBack() {
				uni.navigateBack({
					delta: 1
				})
			},

			// 获取列表
			async stockList() {
				const res = await this.$u.post("api/Invoic/store_find");
				this.textList = res.data
				this.total = this.textList.length

			},

			skip(item) {
				console.log('item', item)
				// this.redactShow = true   pages/stock/inventory
				// uni.navigateTo({
				// 	url: '/pages/stock/addStock?item='+JSON.stringify(item)
				// })


				uni.navigateTo({
					url: '/pages/stock/inventory?id=' + item.id + "&name=" + item.store_name
				})


			},
		}
	}
</script>

<style lang="scss" scoped>
	.conter {
		width: 100%;
		height: 100vh;
		position: relative;
		background-color: #EEEEEE;


		.header {
			width: 100%;
			height: 150rpx;
			line-height: 150rpx;
			display: flex;
			align-items: center;
			// padding-left: 10rpx;
			padding-top: 30rpx;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			background: linear-gradient(to right, #656CE6, #9397FC);

			.arrow {
				position: relative;
				display: inline-block;
			}

			.arrow::before {
				content: '';
				width: 10px;
				height: 10px;
				border: 0px;
				border-bottom: solid 2px #fff;
				border-left: solid 2px #fff;
				-ms-transform: rotate(45deg);
				-webkit-transform: rotate(45deg);
				transform: rotate(45deg);
				position: absolute;
				top: 50%;
				left: 0;
				margin-top: -4px;
				margin-left: 28rpx;
			}

			.title {
				color: #fff;
				margin: 0 auto;
			}
		}







		image {
			width: 100%;
			height: 100%;
		}

		.text-tab {
			padding: 30rpx;
			padding-bottom: 0;


			.box {
				width: 98%;
				margin: 0 auto;
				background-color: #FFFFFF;
				border-radius: 10rpx;

			}

			.marige-bor {
				color: #333333;
				display: flex;
				width: 90%;
				margin: 0 auto;
				font-size: 28rpx;
				// padding: 30rpx;
				align-items: center;
				border-bottom: 1rpx solid #F0F0F0;
				justify-content: space-between;

				.diso-flex {
					width: 100%;
					height: 80rpx;
					display: flex;
					align-items: center;
					font-size: 28rpx;
					justify-content: space-between;
				}

				.conter-image {
					width: 22rpx;
					height: 36rpx;
				}
			}

			.marige-bor:last-child {
				border-bottom: 0;
			}
		}

		.total {
			width: 100%;
			position: fixed;
			bottom: 0;
			left: 0;
			height: 100rpx;
			padding: 0 60rpx 0 30rpx;
			background-color: #FFFFFF;
		}


		.padd-text {
			width: 80%;
			height: 106rpx;
			line-height: 106rpx;
			text-align: center;
			font-size: 28rpx;
			color: #333;
			border-bottom: 1rpx solid #EEEEEE;
			margin: 0 auto;
		}

		.color-text {
			color: #7278EC;
		}

		.none-color {
			color: #000;
		}

		.padd-text:last-child {
			border-bottom: 0;
		}



		.tilte-text {
			color: #333;
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			text-align: center;
			font-size: 32rpx;
		}

		// 加号
		.add {
			position: absolute;
			bottom: 200rpx;
			right: 40rpx;
			width: 140rpx;
			height: 140rpx;
			text-align: center;
			line-height: 100rpx;
			border-radius: 50%;
			font-size: 100rpx;
		}

		.btn-bor {
			width: 90%;
			height: 113rpx;
			color: #7278EC;
			margin: 0 auto;
			line-height: 113rpx;
			margin-top: 40rpx;
			display: flex;
			justify-content: space-around;
			border-top: 1rpx solid #EEEEEE;

			.left-bor {
				border-right: 1rpx solid #EEEEEE;
			}

			text {
				display: inline-block;
				width: 40%;
				height: 113rpx;
				text-align: center;
			}
		}
	}
</style>
